<div id="lista" class="ui-widget">
	<table class="ui-widget ui-widget-content">
		<thead>
			<tr class="ui-widget-header ">
				<th>Nome</th>
				<th>Área</th>
				<th>Filial</th>
				<th>Ramal</th>
			</tr>
		</thead>
		<tbody>
		<?php
		$sql = "SELECT usuarios.nome_completo, areas.descricao AS area, filiais.descricao as filial, usuarios.telefone "; 
		$sql .= "FROM usuarios ";
		$sql .= "INNER JOIN areas ON areas.id = usuarios.area ";
		$sql .= "INNER JOIN filiais ON filiais.id = usuarios.filial ";
		$sql .= "WHERE usuarios.nome_completo SIMILAR TO '[" . $_GET['letras'] . "]%' ";
		$sql .= "ORDER BY usuarios.nome_completo "; 
		$conexao->Executar($sql);
		   if($conexao->ContarLinhas() > 0){
		   	while($line = $conexao->MostrarResultados()){
		       	echo "<tr>
				<td>$line[0]</td>
				<td>$line[1]</td>
				<td>$line[2]</td>
				<td>$line[3]</td>
				</tr>
				";
			}
		} else {
			echo 'Sem registros.';
		}
		$conexao->Liberar();
		?>
		</tbody>
	</table>
</div>